package com.zjj.lbw.ai.component;

import dev.langchain4j.rag.content.Content;
import dev.langchain4j.rag.content.aggregator.ReciprocalRankFuser;

import java.util.List;

/**
 * 测试内容增强器，将多个提示词，查询到的多个结果进行 聚合，按照出现次数计算分数
 */
public class FuseTest {
    public static void main(String[] args) {
        List<Content> list1 = List.of(Content.from("1"), Content.from("2"), Content.from("3"));
        List<Content> list2 = List.of(Content.from("3"), Content.from("4"), Content.from("5"));

        List<Content> list = ReciprocalRankFuser.fuse(List.of(list1, list2));
        System.out.println(list);
    }
}
